package balmysundaycandy.marble.controller.snatch;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;
import org.slim3.datastore.GlobalTransaction;

import balmysundaycandy.marble.broker.model.Test;

public class Slim3GrobalTransactionController extends Controller {

	@Override
	protected Navigation run() {
		Test test = new Test();
		test.setName("test");

		Test test2 = new Test();
		test2.setName("test2");

		GlobalTransaction globalTransaction = Datastore.beginGlobalTransaction();
		globalTransaction.put(test);
		globalTransaction.put(test2);
		globalTransaction.commit();

		return forward("/WEB-INF/jsp/snatch.jsp");
	}
}
